package com.example.lotterysystem.service.dto;

import com.example.lotterysystem.common.enums.ActivityPrizeStatusEnum;
import com.example.lotterysystem.common.enums.ActivityStatusEnum;
import com.example.lotterysystem.common.enums.ActivityUserStatusEnum;
import com.example.lotterysystem.common.enums.PrizeGradeEnum;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class ActivityDetailDTO {
    // 活动信息
    private Long activityId;

    private String activityName;

    private String description;

    private ActivityStatusEnum activityStatus;

    public Boolean valid(){
        return activityStatus.equals(ActivityStatusEnum.RUNNING);
    }

    // 奖品信息
    private List<PrizeDTO> prizeList;

    // 人员信息
    private List<UserDTO> userList;

    @Data
    public static class PrizeDTO{
        private Long prizeId;

        private String prizeName;

        private String description;

        private BigDecimal price;

        private String imageUrl;

        private Long prizeAmount;

        private PrizeGradeEnum prizeGrade;

        private ActivityPrizeStatusEnum prizeStatus;

        public Boolean valid(){
            return prizeStatus.equals(ActivityPrizeStatusEnum.INIT);
        }
    }

    @Data
    public static class UserDTO{
        private Long userId;

        private String userName;

        private ActivityUserStatusEnum userStatus;

        public Boolean valid(){
            return userStatus.equals(ActivityUserStatusEnum.INIT);
        }
    }
}
